// import storage from 'store2'
// import request from '@/utils/request'

const ipcApiRoute = {
  test: 'controller.example.test',
  messageShow: 'controller.example.messageShow',
  messageShowConfirm: 'controller.example.messageShowConfirm',
  selectFolder: 'controller.example.selectFolder',
  openDirectory: 'controller.example.openDirectory',
  loadViewContent: 'controller.example.loadViewContent',
  removeViewContent: 'controller.example.removeViewContent',
  createWindow: 'controller.example.createWindow',
  sendNotification: 'controller.example.sendNotification',
  initPowerMonitor: 'controller.example.initPowerMonitor',
  getScreen: 'controller.example.getScreen',
  openSoftware: 'controller.example.openSoftware',
  autoLaunch: 'controller.example.autoLaunch',
  setTheme: 'controller.example.setTheme',
  getTheme: 'controller.example.getTheme',
  checkForUpdater: 'controller.example.checkForUpdater',
  downloadApp: 'controller.example.downloadApp',
  dbOperation: 'controller.example.dbOperation',
  sqlitedbOperation: 'controller.example.sqlitedbOperation',
  uploadFile: 'controller.example.uploadFile',
  checkHttpServer: 'controller.example.checkHttpServer',
  doHttpRequest: 'controller.example.doHttpRequest',
  doSocketRequest: 'controller.example.doSocketRequest',
  ipcInvokeMsg: 'controller.example.ipcInvokeMsg',
  ipcSendSyncMsg: 'controller.example.ipcSendSyncMsg',
  ipcSendMsg: 'controller.example.ipcSendMsg',
  hello: 'controller.example.hello',
  session:{
    getCookies:"controller.cookies.getCookies",
    setCookies:"controller.cookies.setCookies",
    removeCookie:"controller.cookies.removeCookie"
  },
  system:{
    sendNotification:"controller.system.sendNotification",
    selectFolder:"controller.system.selectFolder",
    Writeclipboard:"controller.system.Writeclipboard",
    getInfoWHduration:"controller.system.getInfoWHduration",
    rmdirasync:"controller.system.rmdirasync", //删除图片和视频文件 1是图片文件夹，2是视频文件夹
    getpathvideo:"controller.system.pathdir", //获取视频数量
    openTxt:"controller.system.openTxt",
    downLoad:"controller.system.downLoad",
    copyClipboard:"controller.system.copyClipboard",


  },
  channel:{
    sendChannels:"controller.channels.sendChannels",
    set_finder_auth:"controller.videohandle.set_finder_auth" //切换账号
  },
  media:{
    getDraftsList:"controller.media.getDraftsList"
  },
  requests:{
    get:"controller.requests.get",
    post:"controller.requests.post",
    blob:"controller.requests.blob",
    downLoad:"controller.requests.downLoad",
    unsplash:"controller.requests.unsplash", //unsplash图
    baiduPic:"controller.requests.baiduPic", //百度图片
  },
  tool:{
    openBrowser:"controller.tool.openBrowser",
    min:"controller.tool.min",
    max:"controller.tool.max",
    close:"controller.tool.close",
    openExe:"controller.tool.openExe"
    },
  openai:{
    generate:"controller.openai.generate",
    ipcSendMsg: 'controller.openai.ipcSendMsg',

  },

  JsonDb:{
    StorageBook:"controller.storageLocal.Books"
  }

}

/**
 * 特殊的路由（频道）定义
 */
 const specialIpcRoute = {
  appUpdater: 'app.updater', // 此频道在后端也有相同定义
  window1ToWindow2: 'window1-to-window2', // 窗口之间通信
  window2ToWindow1: 'window2-to-window1', // 窗口之间通信
}

/**
 * 访问内置http服务
 */
//  const requestHttp = (uri, parameter) => {
//   // url转换
//   const config = storage.get('httpServiceConfig');
//   const host = config.server || 'http://127.0.0.1:7071';
//   let url = uri.split('.').join('/');
//   url = host + '/' + url;
//   console.log('url:', url);
//   return request({
//     url: url,
//     method: 'post',
//     data: parameter, // body
//     params: {}, // URL 参数
//     timeout: 60000,
//   })
// }
export {
  ipcApiRoute,
  specialIpcRoute,
  // requestHttp
}
